<template>
    <div>
        <div>action</div>
        <button @click="loadGiftList">加载数据1</button>
        <button @click="load">加载数据2</button>
        <ul>
            <li v-for="(gift) in giftList">
                {{gift.intt}}
            </li>
        </ul>
    </div>
</template>

<script>
    import {mapActions, mapState} from "vuex"

    export default {
        name: "Action",
        computed: {
            ...mapState(["giftList"])
        },
        methods: {
            ...mapActions(["loadGiftList"]),
            load() {
                this.$store.dispatch("loadGiftList")
            }

        }
    }
</script>

<style scoped>

</style>
